<!DOCTYPE html>

<html>
    <head>
        <title>Student Login</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <link rel="stylesheet" href="css/newcss1.css"/>
    </head>
    <body id="bg">
        <button style="margin-top: 20px;margin-left: 50px; color: #ffffff;background-color: #0099cc;  width: 80px; height: 30px; border-radius: 8px;" onclick="window.open('index.html')">返回首页</button>
        <br>
        <br>
        <br>
        <div class="container padding20 text-center cetDiv" style="background-color:white;width: 420px;height: 350px;margin-top: 50px;border-radius: 20px;">
            <div style="margin-left: 1px">
            <h1 style="font-size: 25px; font-weight: bold;color:#ff9933">学生登录</h1>
            </div>
            <hr><br>
            
            <form action="slogin" class="form-inline" method="post" onsubmit="return slogin();">
                <input id="inputID" name="Sid" type="text" class="form-control" placeholder="请输入学号" style="width: 300px; height: 35px; ">
                <br><br>
                <input id="inputPwd" name="Spwd" type="password" class="form-control " placeholder="请输入登录密码" style=" margin-top: 10px; width: 300px; height: 35px; ">
                <br><br>
                <button type="submit" class="btn" id="login"  style=" margin-top: 30px;color:#ffffff; background-color: #ff9933;  font-size: 18px; width:300px; height: 35px; border: 40px;">登录</button>
            </form>
            <script>
                function slogin(){
                   var x = document.getElementById("inputID").value;
                   var y = document.getElementById("inputPwd").value;
                   var pattern = /^[0-9]{1,10}$/;                 
                    if(pattern.test(x)){
                    }else 
                        if(x==''){
                            alert("请输入学号！");
                            return false;
                        }
                        else 
                        {
                        alert("提交失败!请确保输入正确的格式！");
                        return false;
                        }
                        if(y==''){
                            alert("请输入学生登录密码！");
                            return false;
                        }else{
                            window.location = "index.html";
                            
                        }
            }
            </script>
        </div>
    </body>
</html>
  
